<?php

class CoreReflection
{

    private static ?array $instances = [];

    /**
     * @throws ReflectionException
     */
    final public static function getInstance(String $class)
    {
        if (!isset(self::$instances[$class])) {
            self::$instances[$class] = new ReflectionClass($class);
        }
        return self::$instances[$class];
    }
}